import java.util.*;



 class TreeNode {
     int val = 0;
     TreeNode left = null;
     TreeNode right = null;
     public TreeNode(int val) {
     this.val = val;
     }
 }
public class Test {
    public static TreeNode Convert(TreeNode pRootOfTree) {
        if(pRootOfTree == null){
            return null;
        }
        if(pRootOfTree.left == null && pRootOfTree.right == null){
            return pRootOfTree;
        }
        TreeNode cur = pRootOfTree;
        TreeNode left = Convert(cur.left);
        cur.left = left;
        TreeNode right = Convert(cur.right);
        cur.right = right;
        return cur;
    }

    public static void main(String[] args) {
        
    }
}
